package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

// 测试类
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderQueryService orderQueryService;

    /**
     * 限流实现方式二: 注解定义资源
     *
     * @param orderId
     * @return
     */
    @RequestMapping("/getOrderInfo")
    @ResponseBody
    public String getOrderInfo(@RequestParam("orderId") String orderId) {
        return orderQueryService.queryOrderInfo(orderId);
    }
}
